package com.song.pojo;

import lombok.Data;

/*
* 统一返回结果类
* */
@Data
public class Result {
    private Integer code;//响应码 :1 成功 0 失败
    private String msg;//响应信息
    private Object data;//响应数据

    public static Result success(){
        Result result = new Result();
        result.code = 1;
        result.msg = "success";
        return result;
    }
    public static Result success(Object data){
        Result result = success();
        result.data = data;
        return result;
    }
    public static Result error(String errorMsg){
        Result result = new Result();
        result.code = 0;
        result.msg = errorMsg;
        return result;
    }
}
